import { useState } from 'react';

const DEFAULT_PAGE_SIZE = 20;

function usePagination() {
    const [ pagination, setPagination ] = useState({ pageSize: DEFAULT_PAGE_SIZE, current: 1, showSizeChanger:true })

    const updatePageInfo = (info) => {
        setPagination({
            ...pagination,
            ...info
        });
    }

    return {
        pagination,
        updatePageInfo
    }
}

export default usePagination;